Customize how out of stock products are handled with Algolia AI Search & Discovery.
inventory_quantity
and inventory_policy
attributes of the
product variants resource.
A product variant is out-of-stock if the inventory_quantity
attribute is 0.
The inventory_policy
attribute can be allow
if you explicitly decided to continue selling a product when it’s out of stock. Otherwise, this attribute is deny
.
For handling out-of-stock product variants in the search results,
you can choose between these policies.
inventory_quantity>0
is applied when searching Only in-stock items are included in the search results.inventory_available:true
is applied when searching. The inventory_available
attribute is true, when the inventory_quantity
attribute is greater than 0, or when the inventory_policy
attribute is set to allow
for that product.algolia_autocomplete_product_plugin.js.liquid
file:
algolia_autocomplete.js.liquid
file includes the following changes:
algolia_instant_search.js.liquid
file includes the following changes: